<?php

/**
 * RbisResearch form base class.
 *
 * @method RbisResearch getObject() Returns the current form's model object
 *
 * @package    rbis
 * @subpackage form
 * @author     Norú Moreno, Fahmi Machda, Chandra Prasyeto
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseRbisResearchForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'date'       => new sfWidgetFormDate(),
      'abstract'   => new sfWidgetFormTextarea(),
      'citation'   => new sfWidgetFormTextarea(),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'date'       => new sfValidatorDate(array('required' => false)),
      'abstract'   => new sfValidatorString(array('max_length' => 3000, 'required' => false)),
      'citation'   => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'created_at' => new sfValidatorDateTime(),
      'updated_at' => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('rbis_research[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'RbisResearch';
  }

}
